<%@page import="java.net.URLDecoder"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

	<%
	//获取请求里包含的查询字符串
		String Str=request.getQueryString();
		out.println("原始字符串为:"+Str+"<br/>");
	
	//解码
		String QuerStr=URLDecoder.decode(Str, "UTF-8");
		out.println("解码后的字符串为:"+QuerStr+"<br/>");
		
		String[] param=QuerStr.split("&");
		for(int i=0;i<=param.length-1;i++){
			out.println("每个请求参数名、值对为："+param[i]+"<br/>");
			
			String[] nameval=param[i].split("=");
			out.println("参数值为："+nameval[1]+"<br/>");
		}
	%>

</body>
</html>